#include "stdafx.h"
#include "D3DRemoteProcessCaptor.h"
#include "D3DCaptor.h"

static CD3DRemoteProcessCaptor s_rpcaptor;

BOOL InitHD3D()
{
	return s_rpcaptor.Create();
}

void FinHD3D()
{
	s_rpcaptor.Destroy();
}

HCAPTOR CreateCaptor(LPCSTR szDeviceName)
{
	return (HCAPTOR)s_rpcaptor.CreateCaptor(szDeviceName);
}

void DestroyCaptor(HCAPTOR hCaptor)
{
	s_rpcaptor.DestroyCaptor((CD3DCaptor*)hCaptor);
}

BOOL GetCaptorChange(HCAPTOR hCaptor, D3DFORMAT* pd3dfmt, DWORD* pdwWidth, DWORD* pdwHeight, INT* piPitch, void** ppvBits, RGNDATA** pprd)
{
	return ((CD3DCaptor*)hCaptor)->GetChange(pd3dfmt, pdwWidth, pdwHeight, piPitch, ppvBits, pprd);
}

void CleanCaptorChange(HCAPTOR hCaptor)
{
	((CD3DCaptor*)hCaptor)->CleanChange();
}
